home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / os2 / plnk081.zip / pilot-link.0.8.1 / aclocal.m4 < prev    next >
Text File  |  1997-07-09  |  5KB  |  132 lines

  1. ## libtool.m4 - Configure libtool for the target system. -*-Shell-script-*-
  2. ## Copyright (C) 1996, 1997 Free Software Foundation, Inc.
  3. ## Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  4. ##
  5. ## This program is free software; you can redistribute it and/or modify
  6. ## it under the terms of the GNU General Public License as published by
  7. ## the Free Software Foundation; either version 2 of the License, or
  8. ## (at your option) any later version.
  9. ##
  10. ## This program is distributed in the hope that it will be useful, but
  11. ## WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  13. ## General Public License for more details.
  14. ##
  15. ## You should have received a copy of the GNU General Public License
  16. ## along with this program; if not, write to the Free Software
  17. ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  18. ##
  19. ## As a special exception to the GNU General Public License, if you
  20. ## distribute this file as part of a program that contains a
  21. ## configuration script generated by Autoconf, you may include it under
  22. ## the same distribution terms that you use for the rest of that program.
  23.  
  24. # serial 9 AM_PROG_LIBTOOL
  25. AC_DEFUN(AM_PROG_LIBTOOL,
  26. [AC_REQUIRE([AC_CANONICAL_HOST])
  27. AC_REQUIRE([AC_PROG_CC])
  28. AC_REQUIRE([AC_PROG_RANLIB])
  29. AC_REQUIRE([AM_PROG_LD])
  30. AC_REQUIRE([AC_PROG_LN_S])
  31.  
  32. # Always use our own libtool.
  33. LIBTOOL='$(top_builddir)/libtool'
  34. AC_SUBST(LIBTOOL)
  35.  
  36. dnl Allow the --disable-shared flag to stop us from building shared libs.
  37. AC_ARG_ENABLE(shared,
  38. [  --enable-shared         build shared libraries [default=yes]],
  39. test "$enableval" = no && libtool_shared=" --disable-shared",
  40. libtool_shared=)
  41.  
  42. dnl Allow the --disable-static flag to stop us from building static libs.
  43. AC_ARG_ENABLE(static,
  44. [  --enable-static         build static libraries [default=yes]],
  45. test "$enableval" = no && libtool_static=" --disable-static",
  46. libtool_static=)
  47.  
  48. libtool_flags="$libtool_shared$libtool_static"
  49. test "$silent" = yes && libtool_flags="$libtool_flags --silent"
  50. test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
  51. test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
  52.  
  53. # Some flags need to be propagated to the compiler or linker for good
  54. # libtool support.
  55. [case "$host" in
  56. *-*-irix6*)
  57.   for f in '-32' '-64' '-cckr' '-n32' '-mips1' '-mips2' '-mips3' '-mips4'; do
  58.     if echo " $CC $CFLAGS " | egrep -e "[     ]$f[     ]" > /dev/null; then
  59.       LD="${LD-ld} $f"
  60.     fi
  61.   done
  62.   ;;
  63.  
  64. *-*-sco3.2v5*)
  65.   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
  66.   CFLAGS="$CFLAGS -belf"
  67.   ;;
  68. esac]
  69.  
  70. # Actually configure libtool.  ac_aux_dir is where install-sh is found.
  71. CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
  72. LD="$LD" RANLIB="$RANLIB" LN_S="$LN_S" \
  73. ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
  74. $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
  75. || AC_MSG_ERROR([libtool configure failed])
  76. ])
  77.  
  78. # AM_PROG_LD - find the path to the GNU or non-GNU linker
  79. AC_DEFUN(AM_PROG_LD,
  80. [AC_ARG_WITH(gnu-ld,
  81. [  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
  82. test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
  83. if test "$with_gnu_ld" = yes; then
  84.   AC_MSG_CHECKING([for GNU ld])
  85. else
  86.   AC_MSG_CHECKING([for non-GNU ld])
  87. fi
  88. AC_CACHE_VAL(ac_cv_path_LD,
  89. [case "$LD" in
  90.   /*)
  91.   ac_cv_path_LD="$LD" # Let the user override the test with a path.
  92.   ;;
  93.   *)
  94.   IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  95.   for ac_dir in $PATH; do
  96.     test -z "$ac_dir" && ac_dir=.
  97.     if test -f "$ac_dir/ld"; then
  98.       ac_cv_path_LD="$ac_dir/ld"
  99.       # Check to see if the program is GNU ld.  I'd rather use --version,
  100.       # but apparently some GNU ld's only accept -v.
  101.       # Break only if it was the GNU/non-GNU ld that we prefer.
  102.       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU ld|with BFD)' > /dev/null; then
  103.     test "$with_gnu_ld" = yes && break
  104.       else
  105.         test "$with_gnu_ld" != yes && break
  106.       fi
  107.     fi
  108.   done
  109.   IFS="$ac_save_ifs"
  110.   ;;
  111. esac])
  112. LD="$ac_cv_path_LD"
  113. if test -n "$LD"; then
  114.   AC_MSG_RESULT($LD)
  115. else
  116.   AC_MSG_RESULT(no)
  117. fi
  118. test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
  119. AC_SUBST(LD)
  120. AM_PROG_LD_GNU
  121. ])
  122.  
  123. AC_DEFUN(AM_PROG_LD_GNU,
  124. [AC_CACHE_CHECK([whether we are using GNU ld], ac_cv_prog_gnu_ld,
  125. [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
  126. if $LD -v 2>&1 </dev/null | egrep '(GNU ld|with BFD)' > /dev/null; then
  127.   ac_cv_prog_gnu_ld=yes
  128. else
  129.   ac_cv_prog_gnu_ld=no
  130. fi])
  131. ])
  132.